package cn.thoughtworks.school.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;
import java.util.Map;


@FeignClient(name = "${feign.programCenter.name}",
  url = "${feign.programCenter.url}")
@Service
public interface ProgramCenterFeign {

  @GetMapping("/api/organizations/programs/{programId}")
  Map getProgramById(@PathVariable("programId") Long programId, @RequestHeader("token") String token);

  @GetMapping("/api/v2/assignments/{assignmentId}")
  Map getAssignmentById(@PathVariable("assignmentId") Long assignmentId);

  @GetMapping("/api/programs/{programId}/students/{studentId}/tutors")
  List getMyTutors(@PathVariable("programId") Long programId, @PathVariable("studentId") Long studentId);
}
